package com.hiwhitley.himei.contract.presenter;

import com.hiwhitley.himei.contract.FindMoreContract;
import com.hiwhitley.himei.entity.FindMore;
import com.hiwhitley.himei.mvpframe.rx.RxSchedulers;

import java.util.List;

import rx.Subscriber;

/**
 * Created by hiwhitley on 2016/9/24.
 */

public class FindMorePresenter extends FindMoreContract.Presenter{

    @Override
    public void loadFindMore(String url) {
        mRxManager.add(mModel.getFindMores(url)
                .compose(RxSchedulers.io_main())
                .subscribe(new Subscriber<List<FindMore>>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(List<FindMore> findMores) {
                        mView.showFindMoreView(findMores);
                    }
                })
        );
    }
}
